import { createWebHashHistory, createRouter } from "vue-router";
import HomeView from "../views/home.vue";
const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/home",
    component: HomeView,
  },
  {
    path: "/login",
    component: () => import("../views/login.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

// router.beforeEach(async (to, from) => {
//   console.log('to:',to);
//     if (
//       !localStorage.getItem('info') && !to.path.includes('login')
//     ) {
//       return '/login'
//     }
//   })
export default router;
